function ccR_Mage_CheckForMissingBomb()
	local x
	if # tblPGetNearbyEnemies > 0 then
		for x = 0, 3 do
			local obj = tblPGetNearbyEnemies[x]
			local vSpell = {GetSpellInfo("Mage Bomb")}
			if obj
			and obj:Exists()
			and (obj:IsTappedByPlayer() or (obj:GetTarget():Exists() and obj:GetTarget():GetName() == ccrPlayerName()))
			and obj:GetAura(vSpell[1]) == nil
			and Player:IsFacing(obj)
			and SpellCanAttack("Mage Bomb", obj)
			then
				return true
			end
		end
	else
		return false
	end					
end

function ccR_Mage_ApplyMissingBomb()
	local x
	if # tblPGetNearbyEnemies > 0 then
		for x = 0, 3 do
			local obj = tblPGetNearbyEnemies[x]
			local vSpell = {GetSpellInfo("Mage Bomb")}
			if obj
			and obj:Exists()
			and (obj:IsTappedByPlayer() or (obj:GetTarget():Exists() and obj:GetTarget():GetName() == ccrPlayerName()))
			and obj:GetAura(vSpell[1]) == nil
			and Player:IsFacing(obj)
			and SpellCanAttack("Mage Bomb", obj)
			then
				obj:CastSpellByName(GetSpellInfo("Mage Bomb"))
				return
			end
		end
	end
end
